﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace DSZI
{
    public partial class MainWindow : Window
    {
        public static List<string> categories, cities, sights;
        private static List<Sight> worthSeeing;
        private static bool startWasEnabled, category1WasEnabled, category2WasEnabled,
                            category3WasEnabled, category4WasEnabled, wantsWasEnabled,
                            hatesWasEnabled, queryWasEnabled, searchWasEnabled;
        private static List<CityList> citiesList;
        private string hatesQuery = null;
        private string wantsQuery = null;
        public MainWindow()
        {
            InitializeComponent();
            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            #region LOCKING CONTROLS
            textBlockWorth.Visibility = Visibility.Hidden;
            buttonInfo.Visibility = Visibility.Hidden;
            comboBoxCategory1.IsEnabled = false;
            comboBoxCategory2.IsEnabled = false;
            comboBoxCategory3.IsEnabled = false;
            comboBoxCategory4.IsEnabled = false;
            buttonWants.IsEnabled = false; buttonWantsBlocked();
            buttonHates.IsEnabled = false; buttonHatesBlocked();
            textBoxQuery.IsEnabled = false;
            buttonSearch.IsEnabled = false; buttonSearchBlocked(); textBoxQuery.IsEnabled = false;
            #endregion

            #region CREATING CITIES&LISTS
            cities = new List<string>();
            citiesList = new List<CityList>();
            cities.Add("Chorzów");
            cities.Add("Gdańsk");
            cities.Add("Gdynia");
            cities.Add("Giżycko");
            cities.Add("Hel");
            cities.Add("Kołobrzeg");
            cities.Add("Kowary");
            cities.Add("Kórnik");
            cities.Add("Kraków");
            cities.Add("Łódź");
            cities.Add("Malbork");
            cities.Add("Międzyrzecz");
            cities.Add("Poznań");
            cities.Add("Sopot");
            cities.Add("Świebodzin");
            cities.Add("Toruń");
            cities.Add("Warszawa");
            cities.Add("Wieliczka");
            cities.Add("Wrocław");
            cities.Add("Zakopane");
            foreach (string city in cities)
            {
                comboBoxStartCity.Items.Add(city);
            }
            #endregion

            #region CREATING CATEGORIES
            categories = new List<string>();
            //ogólne
            categories.Add("Kultura");
            categories.Add("Zabytki");
            categories.Add("Rekreacja");
            //kultura
            categories.Add("Urząd");
            categories.Add("Muzeum");
            categories.Add("Filharmonia");
            categories.Add("Edukacja");
            categories.Add("Pomnik");
            categories.Add("Kinematografia");
            categories.Add("Teatr");
            categories.Add("Militaria");
            //zabytki
            categories.Add("Obiekt Sakralny");
            categories.Add("Zabytek Użytkowy");
            categories.Add("Zamek");
            //rekreacja
            categories.Add("Zoo");
            categories.Add("Ogród");
            categories.Add("Kulinaria");
            categories.Add("Morze");
            categories.Add("Krajobraz");
            categories.Add("Park");
            categories.Add("Port");
            categories.Add("Rozrywka");
            categories.Add("Kajakarstwo");
            categories.Add("Jezioro");
            categories.Add("Tor Wyścigowy");
            categories.Add("Stadion");
            categories.Add("Jeździectwo");
            categories.Add("Narciarstwo");
            #endregion

            #region CREATING SIGHTS
            worthSeeing = new List<Sight>();
            //***********************Chorzów
            Sight sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Wesołe Miasteczko";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Planetarium";
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Zoo";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Park Etnograficzny";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Kolejka Liniowa Elka";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Chorzów";
            sight.sightName = "Restauracja \"Polska\"";
            sight.sightCategories.Add("Kulinaria");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            //***********************Gdańsk
            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "Stocznia Gdańska";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Zabytki");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "Westerplatte";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "Gdańsk \"Central\" Park";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Ogród");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "Muzeum Bursztynu";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "ArenaGdańsk";
            sight.sightCategories.Add("Stadion");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdańsk";
            sight.sightName = "Pomnik Neptuna";
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Gdynia
            sight = new Sight();
            sight.sightCity = "Gdynia";
            sight.sightName = "Port Gdyński";
            sight.sightCategories.Add("Port");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Morze");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdynia";
            sight.sightName = "Dar Pomorza";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Port");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdynia";
            sight.sightName = "ORP Błyskawica";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Port");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdynia";
            sight.sightName = "Muzeum Marynarki Wojennej";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Gdynia";
            sight.sightName = "KS Asseco Prokom Gdynia";
            sight.sightCategories.Add("Stadion");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Giżycko
            sight = new Sight();
            sight.sightCity = "Giżycko";
            sight.sightName = "Jezioro Giżyckie";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Giżycko";
            sight.sightName = "Kościół Ewangelicki z 1827 r.";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Giżycko";
            sight.sightName = "Kościół Parafialny Św. Brunona";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Giżycko";
            sight.sightName = "Krzyż Św. Brunona";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Zabytki");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Giżycko";
            sight.sightName = "Most Obrotowy na Kanale Łużyckim";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);
            

            //***********************Hel
            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Tor wyścigowy Hela";
            sight.sightCategories.Add("Tor Wyścigowy");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Kino Foka";
            sight.sightCategories.Add("Kinematografia");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Urząd Podatkowy";
            sight.sightCategories.Add("Urząd");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Latarnia Morska";
            sight.sightCategories.Add("Morze");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Fokarium";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Poligon Wojskowy";
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Hel";
            sight.sightName = "Muzeum Kinematografii";
            sight.sightCategories.Add("Kinematografia");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Kołobrzeg
            sight = new Sight();
            sight.sightCity = "Kołobrzeg";
            sight.sightName = "Plaża";
            sight.sightCategories.Add("Morze");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kołobrzeg";
            sight.sightName = "Aqua Park";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kołobrzeg";
            sight.sightName = "Muzeum Oręża Polskiego";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kołobrzeg";
            sight.sightName = "Latarnia Morska";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kołobrzeg";
            sight.sightName = "ORP Fala";
            sight.sightCategories.Add("Port");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Kowary
            sight = new Sight();
            sight.sightCity = "Kowary";
            sight.sightName = "Park Miniatur i Zabytków";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kowary";
            sight.sightName = "Nowy Dwór";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kowary";
            sight.sightName = "Pałac Cieszyca";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kowary";
            sight.sightName = "Starówka";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Kulinaria");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kowary";
            sight.sightName = "Jezioro \"Płytkie\"";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Kraków
            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Kościół Mariacki";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Wawel";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Sukiennice";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Kopiec Kościuszki";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Tor Kajakarstwa Górskiego";
            sight.sightCategories.Add("Kajakarstwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Filharmonia Karola Szymanowskiego";
            sight.sightCategories.Add("Filharmonia");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kraków";
            sight.sightName = "Filharmonia Krakowska";
            sight.sightCategories.Add("Filharmonia");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Kórnik
            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Arboteum";
            sight.sightCategories.Add("Ogród");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Ratusz";
            sight.sightCategories.Add("Urząd");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Zamek Kórnicki";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Jezioro Kórnickie";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Stadnina";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Jeździectwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Kórnik";
            sight.sightName = "Tor Wyścigów Konnych";
            sight.sightCategories.Add("Tor Wyścigowy");
            sight.sightCategories.Add("Jeździectwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Łódź
            sight = new Sight();
            sight.sightCity = "Łódź";
            sight.sightName = "Miasteczko Filmowe";
            sight.sightCategories.Add("Kinematografia");
            sight.sightCategories.Add("Jeździectwo");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Łódź";
            sight.sightName = "Muzeum \"Łódzkie\"";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Łódź";
            sight.sightName = "Park Sportów Ekstremalnych";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Łódź";
            sight.sightName = "Karting";
            sight.sightCategories.Add("Tor Wyścigowy");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Łódź";
            sight.sightName = "\"Stary\" Dąb";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Ogród");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Malbork
            sight = new Sight();
            sight.sightCity = "Malbork";
            sight.sightName = "Zamek Krzyżacki";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Malbork";
            sight.sightName = "Kąpielisko Miejskie";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Malbork";
            sight.sightName = "Brama Mariacka";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Malbork";
            sight.sightName = "Przystań Jachtowa";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Malbork";
            sight.sightName = "Baraki Krzyżackie";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);
            

            //***********************Międzyrzecz
            sight = new Sight();
            sight.sightCity = "Międzyrzecz";
            sight.sightName = "Spływ Kajakarski";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Kajakarstwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Międzyrzecz";
            sight.sightName = "Muzeum Figur Woskowych";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Międzyrzecz";
            sight.sightName = "Kościół Parafialny";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Międzyrzecz";
            sight.sightName = "Ratusz";
            sight.sightCategories.Add("Urząd");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Międzyrzecz";
            sight.sightName = "Jezioro \"Głębia\"";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Kajakarstwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Poznań
            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Nowe Zoo";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Stare Zoo";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Archikatedra Piotra i Pawła";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Meteoryt Morasko";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Jezioro Maltańskie";
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Kajakarstwo");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Poznań";
            sight.sightName = "Termy Maltańskie";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Sopot
            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Molo Sopockie";
            sight.sightCategories.Add("Morze");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Międzynarodowy Festiwal Piosenki";
            sight.sightCategories.Add("Filharmonia");
            sight.sightCategories.Add("Teatr");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Grand Hotel";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Centrum Motorwodne";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Teatr Snów";
            sight.sightCategories.Add("Teatr");
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Kościół Zbawiciela";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Sopot";
            sight.sightName = "Latarnia Morska";
            sight.sightCategories.Add("Morze");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Świebodzin
            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Figura Chrystusa Króla";
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Aqua Park";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Plac Jana Pawła II";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Kościół Św. Michała";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Ławeczka Niemena";
            sight.sightCategories.Add("Pomnik");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Filharmonia Karola Szymanowskiego";
            sight.sightCategories.Add("Filharmonia");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Świebodzin";
            sight.sightName = "Park Świebodziński";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Toruń
            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Planetarium";
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Krzywa Wieża";
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Park Etnograficzny";
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Ruiny Zamku Krzyżackiego";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Muzeum Fortyfikacji Pancernej";
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Muzeum Kopernika";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Toruń";
            sight.sightName = "Klub Sportów Walki \"Spartakus\"";
            sight.sightCategories.Add("Rozrywka");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Warszawa
            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Sejm";
            sight.sightCategories.Add("Urząd");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Pałac Łazienkowski";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Stadion Narodowy";
            sight.sightCategories.Add("Stadion");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Muzeum Powstania Warszawskiego";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Militaria");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Zoo";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Stadion LEGII";
            sight.sightCategories.Add("Stadion");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Warszawa";
            sight.sightName = "Tor Wyścigowy na Służewcu";
            sight.sightCategories.Add("Tor Wyścigowy");
            sight.sightCategories.Add("Jeździectwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Wieliczka
            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Kopalnia Soli";
            sight.sightCategories.Add("Obiekt Sakralny");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Zamek Żupny";
            sight.sightCategories.Add("Zamek");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Park Adama Mickiewicza";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Pałac Przychodzkich";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Rekreacja");
            sight.sightCategories.Add("Zabytki");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Pałac Konopków";
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Kultura");
            sight.sightCategories.Add("Zabytki");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wieliczka";
            sight.sightName = "Muzeum Techniki";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Zabytek Użytkowy");
            sight.sightCategories.Add("Zabytki");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);
            

            //***********************Wrocław
            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Ogród Japoński";
            sight.sightCategories.Add("Ogród");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Panorama Racławicka";
            sight.sightCategories.Add("Muzeum");
            sight.sightCategories.Add("Edukacja");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Zoo";
            sight.sightCategories.Add("Zoo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Góra Ślęża";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Tor Wyścigów Konnych na Partynicach";
            sight.sightCategories.Add("Tor Wyścigowy");
            sight.sightCategories.Add("Jeździectwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Teatr Współczesny";
            sight.sightCategories.Add("Teatr");
            sight.sightCategories.Add("Kultura");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Wrocław";
            sight.sightName = "Park Wrocławski";
            sight.sightCategories.Add("Ogród");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Zakopane
            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Oscypek Zakopiański";
            sight.sightCategories.Add("Kulinaria");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Skocznia Narciarska";
            sight.sightCategories.Add("Narciarstwo");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Dolina Pięciu Stawów";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Gubałówka";
            sight.sightCategories.Add("Narciarstwo");
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Kasprowy Wierch";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);

            sight = new Sight();
            sight.sightCity = "Zakopane";
            sight.sightName = "Morskie Oko";
            sight.sightCategories.Add("Krajobraz");
            sight.sightCategories.Add("Jezioro");
            sight.sightCategories.Add("Park");
            sight.sightCategories.Add("Rekreacja");
            worthSeeing.Add(sight);
            

            //***********************Adding sights
            sights = new List<string>();
            foreach (Sight current in worthSeeing)
            {
                sights.Add("[" + current.sightCity + "] " + current.sightName);
            }
            #endregion
        }

        #region CONTROLS HANDLERS

        private void LockControls()
        {
            if (comboBoxStartCity.IsEnabled)
            {
                comboBoxStartCity.IsEnabled = false;
                startWasEnabled = true;
            }
            if (comboBoxCategory1.IsEnabled)
            {
                comboBoxCategory1.IsEnabled = false;
                category1WasEnabled = true;
            }
            if (comboBoxCategory2.IsEnabled)
            {
                comboBoxCategory2.IsEnabled = false;
                category2WasEnabled = true;
            }
            if (comboBoxCategory3.IsEnabled)
            {
                comboBoxCategory3.IsEnabled = false;
                category3WasEnabled = true;
            }
            if (comboBoxCategory4.IsEnabled)
            {
                comboBoxCategory4.IsEnabled = false;
                category4WasEnabled = true;
            }
            if (buttonWants.IsEnabled)
            {
                buttonWants.IsEnabled = false;
                buttonWantsBlocked();
                wantsWasEnabled = true;
            }
            if (buttonHates.IsEnabled)
            {
                buttonHates.IsEnabled = false;
                buttonHatesBlocked();
                hatesWasEnabled = true;
            }
            if (textBoxQuery.IsEnabled)
            {
                textBoxQuery.IsEnabled = false;
                queryWasEnabled = true;
            }
            if (buttonSearch.IsEnabled)
            {
                buttonSearch.IsEnabled = false; textBoxQuery.IsEnabled = false;
                buttonSearchBlocked();
                searchWasEnabled = true;
            }
        }

        private void UnlockControls()
        {
            if (startWasEnabled)
            {
                comboBoxStartCity.IsEnabled = true;
                startWasEnabled = false;
            }
            if (category1WasEnabled)
            {
                comboBoxCategory1.IsEnabled = true;
                category1WasEnabled = false;
            }
            if (category2WasEnabled)
            {
                comboBoxCategory2.IsEnabled = true;
                category2WasEnabled = false;
            }
            if (category3WasEnabled)
            {
                comboBoxCategory3.IsEnabled = true;
                category3WasEnabled = false;
            }
            if (category4WasEnabled)
            {
                comboBoxCategory4.IsEnabled = true;
                category4WasEnabled = false;
            }
            if (wantsWasEnabled)
            {
                buttonWants.IsEnabled = true;
                buttonWantsUnblocked();
                wantsWasEnabled = false;
            }
            if (hatesWasEnabled)
            {
                buttonHates.IsEnabled = true;
                buttonHatesUnblocked();
                hatesWasEnabled = false;
            }
            if (queryWasEnabled)
            {
                textBoxQuery.IsEnabled = true;
                queryWasEnabled = false;
            }
            if (searchWasEnabled)
            {
                buttonSearch.IsEnabled = true; textBoxQuery.IsEnabled = true;
                buttonSearchUnblocked();
                searchWasEnabled = false;
            }
        }

        private void FillCategories(ComboBox comboBox)
        {
            comboBox.Items.Clear();
            foreach (string category in categories)
            {
                if (!comboBoxCategory1.Text.Equals(category) &&
                    !comboBoxCategory2.Text.Equals(category) &&
                    !comboBoxCategory3.Text.Equals(category) &&
                    !comboBoxCategory4.Text.Equals(category))
                {
                    comboBox.Items.Add(category);
                    if (category.Equals("Kultura") ||
                        category.Equals("Zabytki") ||
                        category.Equals("Rekreacja"))
                    {
                        comboBox.Items.Add(new Separator());
                    }
                }
            }
        }

        private void StartChecker(object sender, EventArgs e)
        {
            if (!comboBoxStartCity.Text.Equals(""))
            {
                Memory.instance.ForgetWhatUserHates();
                Memory.instance.ForgetWhatUserWants();
                comboBoxCategory1.IsEnabled = true; FillCategories(comboBoxCategory1);
                comboBoxCategory2.IsEnabled = false; comboBoxCategory2.Items.Clear();
                comboBoxCategory3.IsEnabled = false; comboBoxCategory3.Items.Clear();
                comboBoxCategory4.IsEnabled = false; comboBoxCategory4.Items.Clear();
                buttonWants.IsEnabled = false; buttonWantsBlocked();
                buttonHates.IsEnabled = false; buttonHatesBlocked();
                buttonSearch.IsEnabled = false; buttonSearchBlocked(); textBoxQuery.IsEnabled = false;
            }
        }

        private void Category1Checker(object sender, EventArgs e)
        {
            if (!comboBoxCategory1.Text.Equals(""))
            {
                comboBoxCategory2.IsEnabled = true; FillCategories(comboBoxCategory2);
                comboBoxCategory3.IsEnabled = false; comboBoxCategory3.Items.Clear();
                comboBoxCategory4.IsEnabled = false; comboBoxCategory4.Items.Clear();
                buttonWants.IsEnabled = true; buttonWantsUnblocked();
                buttonHates.IsEnabled = true; buttonHatesUnblocked();
                buttonSearch.IsEnabled = true; buttonSearchUnblocked(); textBoxQuery.IsEnabled = true;
            }
        }

        private void Category2Checker(object sender, EventArgs e)
        {
            if (!comboBoxCategory2.Text.Equals(""))
            {
                comboBoxCategory3.IsEnabled = true; FillCategories(comboBoxCategory3);
                comboBoxCategory4.IsEnabled = false; comboBoxCategory4.Items.Clear();
            }
        }

        private void Category3Checker(object sender, EventArgs e)
        {
            if (!comboBoxCategory3.Text.Equals(""))
            {
                comboBoxCategory4.IsEnabled = true; FillCategories(comboBoxCategory4);
            }
        }

        #endregion

        #region MAP HANDLERS

        private void ShowAllCities()
        {
            buttonKolobrzeg.Visibility = System.Windows.Visibility.Visible;
            buttonGdansk.Visibility = System.Windows.Visibility.Visible;
            buttonSopot.Visibility = System.Windows.Visibility.Visible;
            buttonGdynia.Visibility = System.Windows.Visibility.Visible;
            buttonHel.Visibility = System.Windows.Visibility.Visible;
            buttonMalbork.Visibility = System.Windows.Visibility.Visible;
            buttonGizycko.Visibility = System.Windows.Visibility.Visible;
            buttonTorun.Visibility = System.Windows.Visibility.Visible;
            buttonPoznan.Visibility = System.Windows.Visibility.Visible;
            buttonMiedzyrzecz.Visibility = System.Windows.Visibility.Visible;
            buttonSwiebodzin.Visibility = System.Windows.Visibility.Visible;
            buttonKornik.Visibility = System.Windows.Visibility.Visible;
            buttonWarszawa.Visibility = System.Windows.Visibility.Visible;
            buttonLodz.Visibility = System.Windows.Visibility.Visible;
            buttonWroclaw.Visibility = System.Windows.Visibility.Visible;
            buttonKowary.Visibility = System.Windows.Visibility.Visible;
            buttonChorzow.Visibility = System.Windows.Visibility.Visible;
            buttonKrakow.Visibility = System.Windows.Visibility.Visible;
            buttonWieliczka.Visibility = System.Windows.Visibility.Visible;
            buttonZakopane.Visibility = System.Windows.Visibility.Visible;
        }

        private void HideAllCities()
        {
            buttonKolobrzeg.Visibility = System.Windows.Visibility.Hidden;
            buttonGdansk.Visibility = System.Windows.Visibility.Hidden;
            buttonSopot.Visibility = System.Windows.Visibility.Hidden;
            buttonGdynia.Visibility = System.Windows.Visibility.Hidden;
            buttonHel.Visibility = System.Windows.Visibility.Hidden;
            buttonMalbork.Visibility = System.Windows.Visibility.Hidden;
            buttonGizycko.Visibility = System.Windows.Visibility.Hidden;
            buttonTorun.Visibility = System.Windows.Visibility.Hidden;
            buttonPoznan.Visibility = System.Windows.Visibility.Hidden;
            buttonMiedzyrzecz.Visibility = System.Windows.Visibility.Hidden;
            buttonSwiebodzin.Visibility = System.Windows.Visibility.Hidden;
            buttonKornik.Visibility = System.Windows.Visibility.Hidden;
            buttonWarszawa.Visibility = System.Windows.Visibility.Hidden;
            buttonLodz.Visibility = System.Windows.Visibility.Hidden;
            buttonWroclaw.Visibility = System.Windows.Visibility.Hidden;
            buttonKowary.Visibility = System.Windows.Visibility.Hidden; ;
            buttonChorzow.Visibility = System.Windows.Visibility.Hidden;
            buttonKrakow.Visibility = System.Windows.Visibility.Hidden; ;
            buttonWieliczka.Visibility = System.Windows.Visibility.Hidden;
            buttonZakopane.Visibility = System.Windows.Visibility.Hidden;
        }

        private void ShowStartCity()
        {
            if (comboBoxStartCity.SelectedItem.Equals("Kołobrzeg"))
            {
                buttonKolobrzeg.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Gdańsk"))
            {
                buttonGdansk.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Sopot"))
            {
                buttonSopot.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Gdynia"))
            {
                buttonGdynia.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Hel"))
            {
                buttonHel.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Malbork"))
            {
                buttonMalbork.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Giżycko"))
            {
                buttonGizycko.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Toruń"))
            {
                buttonTorun.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Poznań"))
            {
                buttonPoznan.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Międzyrzecz"))
            {
                buttonMiedzyrzecz.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Świebodzin"))
            {
                buttonSwiebodzin.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Kórnik"))
            {
                buttonKornik.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Warszawa"))
            {
                buttonWarszawa.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Łódź"))
            {
                buttonLodz.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Wrocław"))
            {
                buttonWroclaw.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Kowary"))
            {
                buttonKowary.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Chorzów"))
            {
                buttonChorzow.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Kraków"))
            {
                buttonKrakow.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Wieliczka"))
            {
                buttonWieliczka.Visibility = System.Windows.Visibility.Visible;
            }
            if (comboBoxStartCity.SelectedItem.Equals("Zakopane"))
            {
                buttonZakopane.Visibility = System.Windows.Visibility.Visible;
            }
        }

        private void VisibilityChecker(object sender, SelectionChangedEventArgs e)
        {
            HideAllCities();
            HideAllPaths();
            
            ShowStartCity();
        }

        private void HideAllPaths()
        {
            chorzowkrakow.Visibility = System.Windows.Visibility.Hidden;
            chorzowzakopane.Visibility = System.Windows.Visibility.Hidden;
            gdanskhel.Visibility = System.Windows.Visibility.Hidden;
            gdansktorun.Visibility = System.Windows.Visibility.Hidden;
            gdanskmalbork.Visibility = System.Windows.Visibility.Hidden;
            gdyniahel.Visibility = System.Windows.Visibility.Hidden;
            gdyniasopot.Visibility = System.Windows.Visibility.Hidden;
            gizyckowarszawa.Visibility = System.Windows.Visibility.Hidden;
            kolobrzeggdynia.Visibility = System.Windows.Visibility.Hidden;
            kolobrzegmiedzyrzecz.Visibility = System.Windows.Visibility.Hidden;
            korniklodz.Visibility = System.Windows.Visibility.Hidden;
            kornikwroclaw.Visibility = System.Windows.Visibility.Hidden;
            krakowwieliczka.Visibility = System.Windows.Visibility.Hidden;
            lodzchorzow.Visibility = System.Windows.Visibility.Hidden;
            lodzkrakow.Visibility = System.Windows.Visibility.Hidden;
            malborkgizycko.Visibility = System.Windows.Visibility.Hidden;
            malborktorun.Visibility = System.Windows.Visibility.Hidden;
            miedzyrzeczswiebodzin.Visibility = System.Windows.Visibility.Hidden;
            poznankornik.Visibility = System.Windows.Visibility.Hidden;
            poznanmiedzyrzecz.Visibility = System.Windows.Visibility.Hidden;
            sopotgdansk.Visibility = System.Windows.Visibility.Hidden;
            swiebodzinkornik.Visibility = System.Windows.Visibility.Hidden;
            swiebodzinkowary.Visibility = System.Windows.Visibility.Hidden;
            torungdynia.Visibility = System.Windows.Visibility.Hidden;
            torunlodz.Visibility = System.Windows.Visibility.Hidden;
            torunpoznan.Visibility = System.Windows.Visibility.Hidden;
            torunwarszawa.Visibility = System.Windows.Visibility.Hidden;
            warszawalodz.Visibility = System.Windows.Visibility.Hidden;
            wieliczkazakopane.Visibility = System.Windows.Visibility.Hidden;
            wroclawchorzow.Visibility = System.Windows.Visibility.Hidden;
            wroclawkowary.Visibility = System.Windows.Visibility.Hidden;


            //Hide Verticles


            buttonPoznan.Visibility = Visibility.Hidden;

            buttonMiedzyrzecz.Visibility = Visibility.Hidden;

            buttonKolobrzeg.Visibility = Visibility.Hidden;

            buttonGdynia.Visibility = Visibility.Hidden;

            buttonSopot.Visibility = Visibility.Hidden;

            buttonGdansk.Visibility = Visibility.Hidden;
           
            buttonTorun.Visibility = Visibility.Hidden;

            buttonPoznan.Visibility = Visibility.Hidden;

            buttonMiedzyrzecz.Visibility = Visibility.Hidden;

            buttonSwiebodzin.Visibility = Visibility.Hidden;

            buttonKornik.Visibility = Visibility.Hidden;

            buttonWroclaw.Visibility = Visibility.Hidden;

            buttonChorzow.Visibility = Visibility.Hidden;

            buttonLodz.Visibility = Visibility.Hidden;

            
        }

        private void RevealPath(string city1, string city2)
        {
            if ((city1 == "chorzow" && city2 == "krakow") || (city2 == "chorzow"  && city1 == "krakow") )
            chorzowkrakow.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "chorzow" && city2 == "zakopane") || (city2 == "chorzow" && city1 == "zakopane"))
            chorzowzakopane.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gdansk" && city2 == "hek") || (city2 == "gdansk" && city1 == "hel"))
            gdanskhel.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gdansk" && city2 == "torun") || (city2 == "gdansk" && city1 == "torun"))
            gdansktorun.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gdansk" && city2 == "malbork") || (city2 == "gdansk" && city1 == "malbork"))
            gdanskmalbork.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gdynia" && city2 == "hel") || (city2 == "gdynia" && city1 == "hel"))
            gdyniahel.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gdynia" && city2 == "sopot") || (city2 == "gdynia" && city1 == "sopot"))
            gdyniasopot.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "gizycko" && city2 == "warszawa") || (city2 == "gizycko" && city1 == "warszawa"))
            gizyckowarszawa.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "kolobrzeg" && city2 == "gdynia") || (city2 == "kolobrzeg" && city1 == "gdynia"))
            kolobrzeggdynia.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "kolobrzeg" && city2 == "miedzyrzecz") || (city2 == "kolobrzeg" && city1 == "miedzyrzecz"))
            kolobrzegmiedzyrzecz.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "kornik" && city2 == "lodz") || (city2 == "kornik" && city1 == "lodz"))
            korniklodz.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "kornik" && city2 == "wroclaw") || (city2 == "kornik" && city1 == "wroclaw"))
            kornikwroclaw.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "krakow" && city2 == "wieliczka") || (city2 == "krakow" && city1 == "wieliczka"))
            krakowwieliczka.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "lodz" && city2 == "chorzow") || (city2 == "lodz" && city1 == "chorzow"))
            lodzchorzow.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "lodz" && city2 == "krakow") || (city2 == "lodz" && city1 == "krakow"))
            lodzkrakow.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "malbork" && city2 == "gizycko") || (city2 == "malbork" && city1 == "gizycko"))
            malborkgizycko.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "malbork" && city2 == "torun") || (city2 == "malbork" && city1 == "torun"))
            malborktorun.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "miedzyrzecz" && city2 == "swiebodzin") || (city2 == "miedzyrzecz" && city1 == "swiebodzin"))
            miedzyrzeczswiebodzin.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "poznan" && city2 == "kornik") || (city2 == "poznan" && city1 == "kornik"))
            poznankornik.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "poznan" && city2 == "miedzyrzecz") || (city2 == "poznan" && city1 == "miedzyrzecz"))
            poznanmiedzyrzecz.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "sopot" && city2 == "gdansk") || (city2 == "sopot" && city1 == "gdansk"))
            sopotgdansk.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "swiebodzin" && city2 == "kornik") || (city2 == "swiebodzin" && city1 == "kornik"))
            swiebodzinkornik.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "swiebodzin" && city2 == "kowary") || (city2 == "swiebodzin" && city1 == "kowary"))
            swiebodzinkowary.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "torun" && city2 == "gdynia") || (city2 == "torun" && city1 == "gdynia"))
            torungdynia.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "torun" && city2 == "lodz") || (city2 == "torun" && city1 == "lodz"))
            torunlodz.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "torun" && city2 == "poznan") || (city2 == "torun" && city1 == "poznan"))
            torunpoznan.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "torun" && city2 == "warszawa") || (city2 == "torun" && city1 == "warszawa"))
            torunwarszawa.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "warszawa" && city2 == "lodz") || (city2 == "warszawa" && city1 == "lodz"))
            warszawalodz.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "wieliczka" && city2 == "zakopane") || (city2 == "wieliczka" && city1 == "zakopane"))
            wieliczkazakopane.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "wroclaw" && city2 == "chorzow") || (city2 == "wroclaw" && city1 == "chorzow"))
            wroclawchorzow.Visibility = System.Windows.Visibility.Visible;
            if ((city1 == "wroclaw" && city2 == "kowary") || (city2 == "wroclaw" && city1 == "kowary"))
            wroclawkowary.Visibility = System.Windows.Visibility.Visible;
            
        }

        #endregion

        #region CITIES HANDLERS

        private void ShowWorthSeeing(string city)
        {
            List<string> temp = new List<string>();
            foreach (Sight sight in worthSeeing)
            {
                if (sight.sightCity.Equals(city))
                {
                    foreach (string category in sight.sightCategories)
                    {
                        if (category != null)
                        {
                            if (category.Equals(comboBoxCategory1.Text) ||
                                category.Equals(comboBoxCategory2.Text) ||
                                category.Equals(comboBoxCategory3.Text) ||
                                category.Equals(comboBoxCategory4.Text))
                            {
                                temp.Add(sight.sightName);
                            }
                        }
                    }
                }
            }

            textBlockWorth.Visibility = Visibility.Visible;
            if (temp.Any())
            {
                foreach (string sight in temp)
                {
                    textBlockWorth.Text += "- " + sight + "\n";
                }
            }
            else textBlockWorth.Text = "Brak obiektów w zadanych kategoriach";
        }

        private void HideWorthSeeing()
        {
            textBlockWorth.Visibility = Visibility.Hidden;
            textBlockWorth.Text = "";
        }

        private void buttonPoznan_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Poznań");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Poznań.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
            HideAllPaths();
        }

        private void buttonHel_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Hel");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Hel.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonKolobrzeg_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Kołobrzeg");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Kołobrzeg.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonGdansk_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Gdańsk");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Gdańsk.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonSopot_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Sopot");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Sopot.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonGdynia_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Gdynia");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Gdynia.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonKornik_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Kórnik");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Kórnik.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonWarszawa_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Warszawa");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Warszawa.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonMalbork_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Malbork");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Malbork.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonSwiebodzin_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Świebodzin");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Świebodzin.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonMiedzyrzecz_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Międzyrzecz");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Międzyrzecz.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonTorun_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Toruń");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Toruń.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonGizycko_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Giżycko");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Giżycko.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonWroclaw_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Wrocław");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Wrocław.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonKowary_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Kowary");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Kowary.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonLodz_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Łódź");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Łódź.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonChorzow_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Chorzów");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Chorzów.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonKrakow_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Kraków");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Kraków.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonWieliczka_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Wieliczka");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Wieliczka.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        private void buttonZakopane_Click(object sender, MouseButtonEventArgs e)
        {
            HideAllPaths();
            HideAllCities();
            LockControls();
            ShowWorthSeeing("Zakopane");
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Cities\\Zakopane.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Visible;
            buttonInfo.IsEnabled = true;
        }

        #endregion

        private void buttonWants_Click(object sender, MouseButtonEventArgs e)
        {
            var wants = new Wants(comboBoxStartCity.Text);
            wants.ShowDialog();
        }

        private void buttonHates_Click(object sender, MouseButtonEventArgs e)
        {
            var hates = new Hates(comboBoxStartCity.Text);
            hates.ShowDialog();
        }

        private void buttonSearch_Click(object sender, MouseButtonEventArgs e)
        {
            #region TEMP
            
            string categoriesQuery = comboBoxCategory1.Text;
            if (!comboBoxCategory2.Text.Equals(""))
            {
                categoriesQuery += ", " + comboBoxCategory2.Text;
            }
            if (!comboBoxCategory3.Text.Equals(""))
            {
                categoriesQuery += ", " + comboBoxCategory3.Text;
            }
            if (!comboBoxCategory4.Text.Equals(""))
            {
                categoriesQuery += ", " + comboBoxCategory4.Text;
            }

            string[] wants;
            
            if (Memory.instance.UserWantsSomething())
            {
                wants = new string[2] { Memory.instance.RemindWhatUserWants()[0], Memory.instance.RemindWhatUserWants()[1] };
                if (wants[0] != null && wants[1] == null) //użytkownik chce zobaczyć jakieś miasto
                {
                    wantsQuery = wants[0];
                }
                if (wants[0] == null && wants[1] != null) //użytkownik chce zobaczyć jakiś obiekt
                {
                    #region TRIM
                    string temp = wants[1].Substring(1);
                    string city = null;
                    for (int i = 0; i < temp.Length; i++)
                    {
                        if (temp[i] == ']')
                        {
                            city = temp.Remove(i);
                            break;
                        }
                    }
                    #endregion
                    wantsQuery = city;
                }
                if (wants[0] != null && wants[1] != null) //użytkownik chce zobaczyć jakieś miasto i obiekt
                {
                    #region TRIM
                    string temp = wants[1].Substring(1);
                    string city = null;
                    for (int i = 0; i < temp.Length; i++)
                    {
                        if (temp[i] == ']')
                        {
                            city = temp.Remove(i);
                            break;
                        }
                    }
                    #endregion
                    wantsQuery = wants[0] + ", " + city;
                }
            }

            string[] hates;
            
            if (Memory.instance.UserHatesSomething())
            {
                hates = new string[2] { Memory.instance.RemindWhatUserHates()[0], Memory.instance.RemindWhatUserHates()[1] };
                if (hates[0] != null && hates[1] == null) //użytkownik nie chce widzieć jakiegoś miasta
                {
                    hatesQuery = hates[0];
                }
                if (hates[0] == null && hates[1] != null) //użytkownik nie chce widzieć jakiegoś obiektu
                {
                    #region TRIM
                    string temp = hates[1].Substring(1);
                    string city = null;
                    for (int i = 0; i < temp.Length; i++)
                    {
                        if (temp[i] == ']')
                        {
                            city = temp.Remove(i);
                            break;
                        }
                    }
                    #endregion
                    hatesQuery = city;
                }
                if (hates[0] != null && hates[1] != null) //użytkownik nie chce widzieć jakiegoś miasta i obiektu
                {
                    #region TRIM
                    string temp = hates[1].Substring(1);
                    string city = null;
                    for (int i = 0; i < temp.Length; i++)
                    {
                        if (temp[i] == ']')
                        {
                            city = temp.Remove(i);
                            break;
                        }
                    }
                    #endregion
                    hatesQuery = hates[0] + ", " + city;
                }
            }

            string query = null;
            query = "szukajTrasy(" + comboBoxStartCity.Text + ", [" + categoriesQuery + "], [" + wantsQuery + "], [" + hatesQuery + "]).";
            prologQuery.Content = query;
            
            #endregion


            HideAllPaths();




            //Process compiler = new Process();
            //compiler.StartInfo.FileName = "..\\..\\Temp\\SWIReader.exe";
            //compiler.StartInfo.Arguments = @"..\\..\\Temp\\test.pl " + textBoxQuery.Text;
            //compiler.StartInfo.UseShellExecute = false;
            //compiler.StartInfo.CreateNoWindow = true;
            //compiler.StartInfo.RedirectStandardOutput = true;
            //compiler.StartInfo.RedirectStandardInput = true;
            //compiler.Start();

            //string swiOut = compiler.StandardOutput.ReadToEnd();

            //prologQuery.Content = swiOut;


            ////TO DO dodawaj elementy do listy wg wzoru w pętli (dopuki prolog nie skonczy zwracać scieżek)
            //string[] tempvar = new string[7];
            //CityList element = new CityList();
            //element.setList(tempvar);
            //citiesList.Add(element);


            ////TO DO Sprawdź atrakcyjność dla każdej listy miast (Edycja metody calculateActractivnessValue)
            //foreach (CityList CurrentElement in citiesList)
            //{
            //    calculateActractivnessValue(CurrentElement);
            //}

            ////Sortowanie wg wartości

            //SortAllList();


            //Rysowanie najlepszej możliwej ścieżki


            if (hatesQuery != null)
            {
                DrawPath();
            }
            else
            {
                DrawPath2();
            }

            
            

            

        }

        private void DrawPath()
        {
            string[] tempvar = new string[7];
            tempvar[0] = "poznan";
            buttonPoznan.Visibility = Visibility.Visible;
            tempvar[1] = "miedzyrzecz";
            buttonMiedzyrzecz.Visibility = Visibility.Visible;
            tempvar[2] = "swiebodzin";
            buttonSwiebodzin.Visibility = Visibility.Visible;
            tempvar[3] = "kornik";
            buttonKornik.Visibility = Visibility.Visible;
            tempvar[4] = "wroclaw";
            buttonWroclaw.Visibility = Visibility.Visible;
            tempvar[5] = "chorzow";
            buttonChorzow.Visibility = Visibility.Visible;
            tempvar[6] = "lodz";
            buttonLodz.Visibility = Visibility.Visible;

            for (int i = 0; i < 6; i++)
            {
                RevealPath(tempvar[i], tempvar[i + 1]);
            }
        }

        private void DrawPath2()
        {
            string[] tempvar = new string[7];
            tempvar[0] = "poznan";
            buttonPoznan.Visibility = Visibility.Visible;
            tempvar[1] = "miedzyrzecz";
            buttonMiedzyrzecz.Visibility = Visibility.Visible;
            tempvar[2] = "kolobrzeg";
            buttonKolobrzeg.Visibility = Visibility.Visible;
            tempvar[3] = "gdynia";
            buttonGdynia.Visibility = Visibility.Visible;
            tempvar[4] = "sopot";
            buttonSopot.Visibility = Visibility.Visible;
            tempvar[5] = "gdansk";
            buttonGdansk.Visibility = Visibility.Visible;
            tempvar[6] = "torun";
            buttonTorun.Visibility = Visibility.Visible;

            for (int i = 0; i < 6; i++)
            {
                RevealPath(tempvar[i], tempvar[i + 1]);
            }
        }

        private void SortAllList()
        {
            
            for (int i = 0; i < citiesList.Count; i++)
            {
                bool changed = false;
                for (int j = 1; j < citiesList.Count; j++)
                {
                    
                    if (citiesList[i].getValue() < citiesList[j].getValue())
                    {
                        CityList temp = citiesList[i];
                        citiesList[i] = citiesList[j];
                        citiesList[j] = temp;
                        changed = true;
                    }
                }
                if (changed == false) break;
            }
        }

        //TO DO
        private void calculateActractivnessValue(CityList CurrentElement)
        {
            //zmieniamy zawartość elementu currentelement
            //ini
            string[] list = CurrentElement.getList();
            CurrentElement.ClearValue();
            int value=0;

            //Dla każdej kategorii wybranej sprawdzamy każde miasto
            foreach (string city in list)
            {
                //komunikacja z prologiem

                //Dodajemy odebrane wartości atrakcyjności dla 1 miasta z ścieżki dla jednej z kategorii.
                CurrentElement.AddToCurrentValue(value);
                value = 0;
            }

        }

        private void buttonInfo_Click(object sender, MouseButtonEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Backgrounds\\Polska.jpg");
            gridGraph.Background = img;
            buttonInfo.Visibility = System.Windows.Visibility.Hidden;
            buttonInfo.IsEnabled = false;
            HideWorthSeeing();
            UnlockControls();
            ShowStartCity();

            if (hatesQuery != null)
            {
                DrawPath();
            }
            else
            {
                DrawPath2();
            }
           
        }

        #region VISUALS

        private void MouseOverCity(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\CityOver.png");
            Image temp = (Image)sender;
            temp.Source = img.ImageSource;
        }

        private void MouseLeaveCity(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\City.png");
            Image temp = (Image)sender;
            temp.Source = img.ImageSource;
        }

        private void MouseOverHates(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonHatesOver.png");
            buttonHates.Source = img.ImageSource;
        }

        private void MouseLeaveHates(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonHates.png");
            Image temp = (Image)sender;
            buttonHates.Source = img.ImageSource;
        }

        private void buttonHatesBlocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonHatesBlocked.png");
            buttonHates.Source = img.ImageSource;
        }

        private void buttonHatesUnblocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonHates.png");
            buttonHates.Source = img.ImageSource;
        }

        private void MouseOverWants(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonWantsOver.png");
            buttonWants.Source = img.ImageSource;
        }

        private void MouseLeaveWants(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonWants.png");
            Image temp = (Image)sender;
            buttonWants.Source = img.ImageSource;
        }

        private void buttonWantsBlocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonWantsBlocked.png");
            buttonWants.Source = img.ImageSource;
        }

        private void buttonWantsUnblocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonWants.png");
            buttonWants.Source = img.ImageSource;
        }

        private void MouseOverSearch(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonSearchOver.png");
            buttonSearch.Source = img.ImageSource;
        }

        private void MouseLeaveSearch(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonSearch.png");
            Image temp = (Image)sender;
            buttonSearch.Source = img.ImageSource;
        }

        private void buttonSearchBlocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonSearchBlocked.png");
            buttonSearch.Source = img.ImageSource;
        }

        private void buttonSearchUnblocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonSearch.png");
            buttonSearch.Source = img.ImageSource;
        }

        private void MouseOverInfo(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonInfoOver.png");
            buttonInfo.Source = img.ImageSource;
        }

        private void MouseLeaveInfo(object sender, MouseEventArgs e)
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonInfo.png");
            Image temp = (Image)sender;
            buttonInfo.Source = img.ImageSource;
        }

        private void buttonInfoBlocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonInfoBlocked.png");
            buttonInfo.Source = img.ImageSource;
        }

        private void buttonInfoUnblocked()
        {
            ImageBrush img = new ImageBrush();
            img.ImageSource = (ImageSource)new ImageSourceConverter().ConvertFromString("..\\..\\Resources\\Buttons\\ButtonInfo.png");
            buttonInfo.Source = img.ImageSource;
        }

        #endregion
    } 
}
